// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "AbilitySystem/Abilities/LyraGameplayAbility.h"

#include "LyraGameplayAbility_Reset.generated.h"

#define UE_API LYRAGAME_API

class AActor;
class UObject;
struct FGameplayAbilityActorInfo;
struct FGameplayEventData;

/**
 * ULyraGameplayAbility_Reset
 *
 *	用于快速将玩家重置回初始生成状态的游戏玩法能力。
 *	该能力通过 "GameplayEvent.RequestReset" 能力触发标签自动激活（仅限服务器）。
 */
UCLASS(MinimalAPI)
class ULyraGameplayAbility_Reset : public ULyraGameplayAbility
{
	GENERATED_BODY()

public:
	/**
	 * 构造函数
	 *
	 * @param ObjectInitializer 用于属性初始化的对象初始化器
	 */
	UE_API ULyraGameplayAbility_Reset(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());

protected:
	/**
	 * 激活能力
	 *
	 * @param Handle 能力规格句柄
	 * @param ActorInfo 能力执行者信息
	 * @param ActivationInfo 能力激活信息
	 * @param TriggerEventData 触发能力的事件数据
	 */
	UE_API virtual void ActivateAbility(const FGameplayAbilitySpecHandle Handle, const FGameplayAbilityActorInfo* ActorInfo, const FGameplayAbilityActivationInfo ActivationInfo, const FGameplayEventData* TriggerEventData) override;
};

/**
 * 玩家重置消息结构体
 */
USTRUCT(BlueprintType)
struct FLyraPlayerResetMessage
{
	GENERATED_BODY()

	UPROPERTY(BlueprintReadOnly)
	TObjectPtr<AActor> OwnerPlayerState = nullptr; // 拥有者玩家状态对象指针
};

#undef UE_API